import Vue from 'vue';
import Router from 'vue-router';
import Edit from '@/views/editComponent/edit';
import Check from '@/views/editComponent/check';

Vue.use(Router);

export const router = new Router({
  routes: [
    {
      path: '/',
      name: '',
      component: () => import('@/views/login/index'),
      meta: {
        needLogin: true,
      },
    },
    {
      path: '/index',
      name: 'index',
      component: () => import('@/views/login/index'),
      meta: {
        needLogin: true,
      },
    },
    {
      path: '/invitation',
      name: 'invitation',
      component: () => import('@/views/invitation/index'),
      meta: {
        needLogin: true,
      },
    },
    {
      path: '/virtuallist',
      name: 'virtuallist',
      component: () => import('@/views/virtualList/index'),
      meta: {
        needLogin: false,
      },
    },
    {
      path: '/flycloud',
      name: 'flycloud',
      component: () => import('@/views/flycloud/index'),
      meta: {
        needLogin: false,
      },
    },
    {
      path: '/editComponent',
      name: 'editComponent',
      component: () => import('@/views/editComponent/index'),
      meta: {
        needLogin: false,
      },
      children: [
        { path: '/edit', component: Edit },
        { path: '/check', component: Check },
      ],
    },
  ],
});
